\documentclass[12pt]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{fancyhdr}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{listings}
\usepackage[normalem]{ulem}
\usepackage[font=footnotesize,format=plain,labelfont=bf,up,textfont=it,up,justification=centering]{caption}
\usepackage[hidelinks]{hyperref}
\usepackage{pdflscape}
\setlength{\textwidth}{481pt} % Largeur de la zone de texte (17cm)
\setlength{\oddsidemargin}{0pt} % Marge gauche sur pages impaires
\setlength{\evensidemargin}{0pt} % Marge gauche sur pages paires
\setlength{\topmargin}{0pt} % Pas de marge en haut
\setlength{\headheight}{12pt} % Haut de page
\setlength{\headsep}{25pt} % Entre le haut de page et le texte
\setlength{\footskip}{30pt} % Bas de page + séparation
\setlength{\textheight}{620pt} % Hauteur de la zone de texte (25cm)
\setlength{\parindent}{0cm}
\setstretch{1.2}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{3}
\makeatletter
\newcounter {subsubsubsection}[subsubsection]
\renewcommand\thesubsubsubsection{\thesubsubsection .\@alph\c@subsubsubsection}
\newcommand\subsubsubsection{\@startsection{subsubsubsection}{4}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries}}
\newcommand*\l@subsubsubsection{\@dottedtocline{3}{10.0em}{4.1em}}
\newcommand*{\subsubsubsectionmark}[1]{}
\makeatother

%Page de garde
\makeatletter
\def\clap#1{\hbox to 0pt{\hss #1\hss}}%
\def\ligne#1{%
\hbox to \hsize{%
\vbox{\centering #1}}}%
\def\haut#1#2#3{%
\hbox to \hsize{%
\rlap{\vtop{\raggedright #1}}%
\hss
\clap{\vtop{\centering #2}}%
\hss
\llap{\vtop{\raggedleft #3}}}}%
\def\bas#1#2#3{%
\hbox to \hsize{%
\rlap{\vbox{\raggedright #1}}%
\hss
\clap{\vbox{\centering #2}}%
\hss
\llap{\vbox{\raggedleft #3}}}}%
\def\maketitle{%
\thispagestyle{empty}\vbox to \vsize{%
\haut{}{\@blurb}{}
\vfill
\vspace{1cm}
\begin{flushleft}
%\usefont{OT1}{ptm}{m}{n}
\huge \@title
\end{flushleft}
\par
\hrule height 3pt
\par
\begin{flushright}
%\usefont{OT1}{phv}{m}{n}
\large \@author
\par
\end{flushright}
\vspace{1cm}
\vfill
\vfill
\bas{}{\@location\ - \@date}{}
}%
\cleardoublepage
}
\def\date#1{\def\@date{#1}}
\def\author#1{\def\@author{#1}}
\def\title#1{\def\@title{#1}}
\def\location#1{\def\@location{#1}}
\def\blurb#1{\def\@blurb{#1}}
\date{\today}
\author{}
\title{}
\blurb{}
\makeatother
\title{User Manual\\\Large MeteoCal}
\author{Adrien \textsc{Bestel}\\Jorge \textsc{Vera}\\}
\location{Milano}




\date\today

\begin{document}
\newpage
\begin{figure}[t]
        \includegraphics[height = 20mm]{logo.png}
\end{figure}
\vspace{-15cm}
\maketitle
\thispagestyle{empty}
\newpage
\tableofcontents
\newpage
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.01mm}
\lhead{\footnotesize Adrien \textsc{Bestel} - Jorge \textsc{Vera}}
\rhead{\footnotesize User Manual - MeteoCal}

\clearpage
\section{Deploying MeteoCal}

The followings are the steps you need to follow to be able to deploy meteocal in your system.

\subsection{Requirements}
Required Tools:
\begin {itemize}
\item Java SE Development kit 8.
\item Glassfish Open Source Edition 4.1.
\item IDE for Java EE (in the development was used just Eclipse).
\item Maven.
\item MySQL Community Server.
\end {itemize}

\vspace{0.5cm}
In the database is required a database named 'dbmeteocalbestelvera' and a user called 'bestelvera' with password 'nacho'.

Then you need to set up a MySQL connection pool form the glassfish server directing to the database with the following details:
\begin{itemize}
\item Database name: dbmeteocalbestelvera
\item User: bestelvera
\item Password: nacho
\item URL: your database url
\item ServerName: localhost
\end{itemize}

With this connection pool created you need to set up a JDBC resource with the connection pool reffered. And with the resource you need to create a JDBCRealm as it follows:
\begin{itemize}
\item Realm name: JDBCRealmRegistration.
\item Class name: JDBCRealm.
\item JAAS Context: jdbcRealm.
\item JNDI: your resource name.
\item User table: user
\item User name column: username
\item Pasword column: password
\item Group table: user
\item Group name column: groupname
\item Password encryption algorithm: MD5
\item Digest algorithm: SHA-256
\end{itemize}

\subsection{Deployment}
This is the procedure to deploy MeteoCal from Eclipse IDE. Go to import Maven project, then select the src folder of MeteoCal and then run it on your Glassfish server. Now you will be able to access to the MeteoCal system from your browser.

\subsection{Testing}
To check that everything is working fine on your MeteoCal setup there is some test cases created for this. Go in the Eclipse package explorer and find the folder 'test' inside MeteoCal, right click on it and select run as JUnit test. If all the tests are passed, you are ready to enjoy MeteoCal at the most. If there is a non sucsessful test, check your environment configuration as the steps above.

\clearpage

\section{User Functionalities}
Here will be explained all the functionalities of MeteoCal and how to perform them.

\subsection{Login}
To login, on the first MeteoCal screen, you have to put your email address and your password, if they match, you will be redirected to your profile. Otherwise you will be given an advertisement due a bad login.

\begin{figure}[ht!]
	\begin{center}
		\includegraphics[width=17cm]{LoginForm.png}
		\caption{Login Form in MeteoCall}
		\label{fig:LoginForm}
	\end{center}
\end{figure}

\clearpage
\subsection{Register}
To register, on the first MeteoCal screen, click the Register button, you will be redirected to a registration form and is going to ask you for your details, once you are finished click on register and your profile will be created, if there is any error in the creation of your profile you will be told what has gone wrong.

\begin{figure}[ht!]
	\begin{center}
		\includegraphics[width=17cm]{RegistrationForm.png}
		\caption{Registration Form in MeteoCall}
		\label{fig:RegistrationForm}
	\end{center}
\end{figure}

\clearpage
\subsection{Check your events}
On your profile screen, after you logged in, you can see at the right side the upcoming events, also the events that you are the host or the events you have been invited. 

\begin{figure}[ht!]
	\begin{center}
		\includegraphics[width=17cm]{Profile.png}
		\caption{User Profile in MeteoCall}
		\label{fig:Profile}
	\end{center}
\end{figure}

You can click on the events' name and you will be redirected to the event screen where you can find the guests, location, forecast and other details as shown on the following picture:

\begin{figure}[ht!]
	\begin{center}
		\includegraphics[width=17cm]{ViewEvent.png}
		\caption{Event View in MeteoCall}
		\label{fig:EventView}
	\end{center}
\end{figure}

\clearpage
\subsection{Create event}
To create an event, once in your profile, click the button Create Event and you will be asked for the event details and the invitees. Once you have completed them, click on create and the event is going to be created. If there is anything wrong on the event creation, you will be advised.

\begin{figure}[ht!]
	\begin{center}
		\includegraphics[width=17cm]{CreateEvent.png}
		\caption{Create Event Form in MeteoCall}
		\label{fig:CreateEvent}
	\end{center}
\end{figure}

\clearpage

\subsection{Notifications}
Once you are in your profile you will be advised if you have new notifications, a box will be above your events and you will be able to check your notifications.

\begin{figure}[ht!]
	\begin{center}
		\includegraphics[width=17cm]{ProfileWithNotifications.png}
		\caption{Profile with Notifications Form in MeteoCall}
		\label{fig:ProfileNotifications}
	\end{center}
\end{figure}


Then If you press the notifications advice you will be shown all your notifications, where you are able to mark them as read, accept or decline suggestions made .


\begin{figure}[ht!]
	\begin{center}
		\includegraphics[width=17cm]{Notifications.png}
		\caption{Notifications m in MeteoCall}
		\label{fig:Notifications}
	\end{center}
\end{figure}


\subsection{Logout}
Once you are logged in you can simply logout pressing the logout button on the right top corner of the screen.


\clearpage

\end{document}